package com.lovecws.mumu.ffmpeg.thumb;

import com.lovecws.mumu.ffmpeg.video.VideoInfo;
import com.lovecws.mumu.ffmpeg.video.VideoInfoService;

import java.io.IOException;

public class VideoLastThumbTaker extends VideoThumbTaker
{
    public VideoLastThumbTaker(String ffmpegApp)
    {
        super(ffmpegApp);
    }

    public void getThumb(String videoFilename, String thumbFilename, int width,
            int height) throws IOException, InterruptedException
    {
        VideoInfoService videoInfoService = new VideoInfoService(ffmpegApp);
        VideoInfo videoInfo = videoInfoService.getInfo(videoFilename);
        super.getThumb(videoFilename, thumbFilename, width, height, videoInfo.getHours(), videoInfo.getMinutes(),videoInfo.getSeconds() - 0.2f);
    }
}